package top.software.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: Message
 * @Author: Amosen
 * @Since: 2021/4/20
 */
public class Message {

    private Map<String, Object> data = new HashMap<>();

    private Integer code;

    private String message;

    public Message(){}

    public Message(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Message res(Integer code, String message) {
        this.code = code;
        this.message = message;
        return this;
    }

    public Message addData(String key, Object value) {
        this.data.put(key, value);
        return this;
    }

    public Map<String, Object> getData() {
        return this.data;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

}
